package com.hbean.system.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Description: null
 * @Project: hbean
 * @Author: hjibo
 * @CreateDate: 2018-10-01 08:32
 * @ModificationHistory:
 */

@Slf4j
@Component
@Order(999)
public class SysConfig implements CommandLineRunner {

    @Autowired
    private PropertiesConfig propertiesConfig;

    public static String serverName;
    public static String password;
    public static String nettyHost;
    public static int nettyPort;
    public static int sessionOutTime;
    public static String filePath;

    @Override
    public void run(String... args) throws Exception {
        log.info("###### 初始化系统配置 ######");
        this.serverName = propertiesConfig.getServerName();
        this.password = propertiesConfig.getPassword();
        this.nettyHost = propertiesConfig.getNettyHost();
        this.nettyPort = propertiesConfig.getNettyPort();
        this.sessionOutTime = propertiesConfig.getSessionOutTime();
        this.filePath = propertiesConfig.getFilePath();
    }






}
